package com.deer.wms.ware.task.web;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.deer.wms.project.root.core.result.Result;
import com.deer.wms.project.root.core.result.ResultGenerator;
import com.deer.wms.project.root.core.service.QueryCriteria;
import com.deer.wms.ware.task.model.Box.BoxDetail;
import com.deer.wms.ware.task.model.ErpPushLog;
import com.deer.wms.ware.task.model.ErpPushLogInfo;
import com.deer.wms.ware.task.model.erpBean.ErpBase;
import com.deer.wms.ware.task.service.ErpPushLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: xu
 * @Date: 2022/06/14/14:43
 * @Description:
 */
@RestController
@RequestMapping("/erp/push/log")
public class ErpPushLogController {
    @Autowired
    private ErpPushLogService erpPushLogService;


    @GetMapping("/page")
    public Result page(ErpBase criteria) {
        PageHelper.startPage(criteria.getPageNum(), criteria.getPageSize());
        List<ErpPushLog> list = erpPushLogService.findPage(criteria);
        PageInfo pageInfo = new PageInfo(list);
        return ResultGenerator.genSuccessResult(pageInfo);
    }

    @GetMapping("detail/{id}")
    public Result detail(@PathVariable Integer id) {
       List<ErpPushLogInfo> list =  erpPushLogService.detail(id);
        return ResultGenerator.genSuccessResult(list);
    }



}
